<template>
	<view>
		<view v-for="(item,index) in colorList" :key="index" :style="'background-color:rgb('+item.r+','+item.g+','+item.b+')'" >
			{{item.r}},{{item.g}},{{item.b}}
		</view>
	</view>
</template>

<script>
	export default {
		
		onPullDownRefresh() {
			console.log("触发了下拉的方法")
			// 手动的结束了下拉窗口
			setTimeout(() => {
				uni.stopPullDownRefresh()
			}, 1000)
		},
		onShow() {
		    console.log('页面显示')
					uni.showToast({
						title: '欢迎来到七彩',
						duration: 500,
						icon:'none'
					});
		},
		data() {
			return {
				colorList: []
			}
		},
		onReachBottom() {
			console.log("上拉触底")
			const r = Math.floor(Math.random()*255)
			const g = Math.floor(Math.random()*255)
			const b = Math.floor(Math.random()*255)
			this.colorList.push({r,g,b})
		},
		methods: {

		}
	}
</script>

<style>
	page {
		height: 101vh;
		BackgroundColor: ;
	}
	view{
		height: 200rpx;
		line-height: 200rpx;
	}
</style>
